package com.rgp.servicemap.controller;

import com.rgp.internalcommon.dto.ResponseResult;
import com.rgp.servicemap.service.ServiceFromMapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author nhp
 * @version 1.0
 * @description TODO
 * @date 2024-04-19 17:15
 */
@RestController
public class ServiceController {

    @Autowired
    private ServiceFromMapService serviceFromMapService;

    @PostMapping("service/add")
    public ResponseResult addService(@RequestParam("name") String name){
        return serviceFromMapService.addService(name);
    }

    @DeleteMapping("service/delete")
    public ResponseResult deleteService(@RequestParam("sid") String sid){
        return serviceFromMapService.deleteService(sid);
    }

    @GetMapping("service/list")
    public ResponseResult listService(){
        return serviceFromMapService.listService();
    }
}